import logging,yagmail,pytest,os
def log():
    logging.basicConfig(
        filename='log.log',
        level=logging.DEBUG,
        filemode='a+',
        format='%(message)s' '%(filename)s' '%(levelname)s' '%(asctime)s' '%(lineno)d'
    )

def youjian(file):
    mail = yagmail.SMTP(user='2018675435@qq.com', password='nnqakcckuzyqfebd', host='smtp.qq.com')
    mail.send(to='2018675435@qq.com', subject='测试报告', contents=file)
    return mail

def allure():
    pytest.main([r'D:\Gao6\Auto_Wms\ZY\jiuxian\test_case\test_case.py','--alluredir==.report'])
    os.system(f'allure generate .report -o allure')